public class Princess extends Player {


    public Princess(String name) {
        super(name);
    }

    public void show()
    {
        System.out.println(name+"坐标是"+x+","+y);
        System.out.println("英雄快来救我");
    }

    public  void move()
    {
        int p=(int)(1+Math.random()*(4));

        if (p==1)
        {
            System.out.println(name+"向上移动，当前坐标为："+x+","+(++y));
        }

        else if (p==2)
        {
            System.out.println(name+"向下移动，当前坐标为："+x+","+(--y));
        }
        else if (p==3)
        {
            System.out.println(name+"向左移动，当前坐标为："+(--x)+","+y);
        }
        else if (p==4)
        {
            System.out.println(name+"向右移动，当前坐标为："+(++x)+","+y);
        }
    }

}
